package websocket;
import java.awt.image.BufferedImage;
import java.io.IOException;
import javax.inject.Inject;
import javax.websocket.OnMessage;
import javax.websocket.server.ServerEndpoint;
import webcam.CamCapture;
/**
 *
 * @author Jens-MariusNergård
 */
@ServerEndpoint("/cam")
public class endpoint {
    
    @Inject 
    CamCapture camCap;
    
    public endpoint(){
    }

    @OnMessage
    public BufferedImage onMessage(String message) throws IOException {
        return camCap.getImage();
    }
    
    
    public BufferedImage onConnect() throws IOException {
        return camCap.getImage();
    }
}